#include <iostream>
#include <cstring>
using namespace std;

void dfs(int num[1001], int flag[1001], int beginSite, int totalSite, int remainNum);

int main(){
	int n;
	int result;
	cin >> n >> result;
	int num[1001];
	for(int i = 1; i <= n; i++)
		cin >> num[i];
	int flag[1001];
	memset(flag, 0, sizeof(flag));
	dfs(num, flag, 1, n, result);
}

void dfs(int num[1001], int flag[1001], int beginSite, int totalSite, int remainNum){
	if(remainNum < 0) return;
	if(remainNum == 0){
		for(int i = 1; i <= totalSite; i++)
			if(flag[i] == 1) cout << num[i] << ' ';
		cout << endl;
		return;
	}
	if(beginSite <= totalSite){
		flag[beginSite] = 1;
		dfs(num, flag, beginSite + 1, totalSite, remainNum - num[beginSite]);
		flag[beginSite] = 0;
		dfs(num, flag, beginSite + 1, totalSite, remainNum);
	}
}
